package com.cn.wanxi.service.impl;

import com.cn.wanxi.dao.ProductDao;
import com.cn.wanxi.dao.impl.ProductImpl;
import com.cn.wanxi.model.ProductModel;
import com.cn.wanxi.model.ResultModel;
import com.cn.wanxi.service.ProductService;

/**
 * 服务逻辑层
 */
public class ProductServiceImpl implements ProductService {
    private ProductDao productDao = new ProductImpl();

    @Override
    public ResultModel add(ProductModel productModel) {

        return ResultModel.getResultModel(productDao.add(productModel));
    }

    @Override
    public ResultModel delete(ProductModel productModel) {
        return ResultModel.getResultModel(productDao.delete(productModel));
    }

    @Override
    public ResultModel findAll(ProductModel productModel) {
        return ResultModel.getResultModel(productDao.getCount(productModel), productDao.findAll(productModel));
    }

    @Override
    public ResultModel update(ProductModel productModel) {
        return null;
    }

    @Override
    public ResultModel findById(ProductModel productModel) {
        return null;
    }

    @Override
    public ResultModel getCount(ProductModel productModel) {
        return null;
    }

}
